/**
\defgroup fs_interface_api File Interface
\brief An API that enables integration of standard C library with an arbitrary file system
@{
*/

/**
\defgroup fs_interface_definitions Definitions
@{
*/

/**
\defgroup fs_interface_open_modes Open Modes
@{
  \def RT_OPEN_RDONLY
  \def RT_OPEN_WRONLY
  \def RT_OPEN_RDWR
  \def RT_OPEN_APPEND
  \def RT_OPEN_CREATE
  \def RT_OPEN_TRUNCATE
@}
*/

/**
\defgroup fs_interface_attributes Attributes
@{
  \def RT_ATTR_FILE
  \def RT_ATTR_DIR
  \def RT_ATTR_LINK
  \def RT_ATTR_RD
  \def RT_ATTR_WR
@}
*/

/**
\defgroup fs_interface_seek_operations Seek Operations
@{
  \def RT_SEEK_SET
  \def RT_SEEK_CUR
  \def RT_SEEK_END
@}
*/

/**
\defgroup fs_interface_return_codes Return Codes
@{
  \def RT_ERR
  \def RT_ERR_NOTSUP
  \def RT_ERR_INVAL
  \def RT_ERR_IO
  \def RT_ERR_NOTFOUND
  \def RT_ERR_EXIST
  \def RT_ERR_ISDIR
  \def RT_ERR_NOSPACE
  \def RT_ERR_READONLY
  \def RT_ERR_FILEDES
  \def RT_ERR_MAXPATH
  \def RT_ERR_BUSY
  \def RT_ERR_NOTEMPTY
  \def RT_ERR_MAXFILES
  \def RT_ERR_OVERFLOW
@}
*/

/**
@}
*/

/**
  \struct rt_fs_time_t

  \details
  This struct contains time and date information, including seconds, minutes,
  hours, day of the month, month of the year and year.
  Values outside of the specified range are treated as invalid. Reserved bits
  should be ignored.
*/

/**
  \struct rt_fs_stat_t

  \details
  This struct contains various attributes and metadata about a file or directory in
  a filesystem, including its attribute bitmap, access time, modification time,
  change time and filesystem specific block size and block count allocated to store
  the file.
*/

/**
  \fn int32_t rt_fs_open (const char *path, int32_t mode)

  \details
  This function opens a file specified by the pathname.

  The mode parameter is a bitmap that specifies the file open mode.
  The following bits are exclusive:
  - FS_OPEN_RDONLY: open file for reading only
  - FS_OPEN_WRONLY: open file for writing only
  - FS_OPEN_RDWR:   open file for reading and writing

  In addition, any combination of the values below can be set:
  - FS_OPEN_APPEND: if set, the file offset is set to the end of file prior to each write
  - FS_OPEN_CREATE: if set, the file is created if it does not exist
  - FS_OPEN_TRUNCATE: if set, the size of an existing file opened for writing is truncated to zero

  The file position offset shall be set to the beginning of the file unless append mode is specified.
*/

/**
  \fn int32_t rt_fs_close (int32_t fd)

  \details
  This function closes the file associated with the file descriptor fd.
*/

/**
  \fn int32_t rt_fs_write (int32_t fd, const void *buf, uint32_t cnt)

  \details
  This function shall write cnt bytes from the buffer pointed to by buf to the
  file associated with the open file descriptor, fd.
*/

/**
  \fn int32_t rt_fs_read (int32_t fd, void *buf, uint32_t cnt)

  \details
  This function reads cnt bytes from the file associated with the file
  descriptor fd, into the buffer pointed to by buf.
  The actual number of bytes read can be less than cnt.
*/

/**
  \fn int64_t rt_fs_seek (int32_t fd, int64_t offset, int32_t whence)

  \details
  This functions moves the file position pointer as specified with parameters
  offset and whence.
  Parameter whence can have the following possible values:
  - RT_SEEK_SET: set the file position pointer to offset bytes from the start of the file
  - RT_SEEK_CUR: set the file position pointer to offset bytes from the current location
  - RT_SEEK_END: set the file position pointer to offset bytes from the end of the file
*/

/**
  \fn int64_t rt_fs_size (int32_t fd)

  \details
  This function retrieves the size of an opened file.
*/

/**
  \fn int32_t rt_fs_stat (int32_t fd, rt_fs_stat_t *stat)

  \details
  This function retrieves status information about the file associated with the
  given file descriptor. The status information is stored in the rt_fs_stat_t
  struct pointed to by stat.
  The function shall return with error if fd is not a valid file descriptor or
  if parameter stat is NULL.
*/

/**
  \fn int32_t rt_fs_remove (const char *path)

  \details
  If removing a directory, the directory must be empty.
*/


/**
  \fn int32_t rt_fs_rename (const char *oldpath, const char *newpath)

  \details
  This function changes the name of a file or directory.

  If the destination exists, it must match the source in type.
  If the destination is a directory, the directory must be empty.
*/

/**
@}
*/